<style type="text/css">
	#right-content #tabs {
		width: 100%;
		margin-bottom: 20px;
	}
	#right-content #tabs ul {
		height: 40px;
		border-bottom: 1px solid #aaa;
	}
	#right-content #tabs ul li{
		float: left;
		list-style: none;
		line-height: 40px;
		background: #f4f4f4;
		padding: 0px 15px;
		border-bottom: 1px solid #aaa;
		cursor: pointer;
	}
	.tabActiveHeader {
		height: 40px;
		background: #fff !important;
		border: 1px solid #aaa !important;
		border-bottom: none !important;
		
	}
</style>
<?php echo $this->element('slide'); ?>
<section id="content">
	<section id="left-bar">
		<div class="box-left">
			<?php echo $this->element('categories'); ?>
		</div>
		
		<div class="box-left">
			<?php echo $this->element('genres')?>
		</div>
		
		
		<div class="box-left">
			<h2>Bảng xếp hạng</h2>
			<div class="menu-left">
				<ul>
					<li>
						<a href="#" class="top2"><span>1</span>Giáo dục</a>
					</li>
					
					<li>
						<a href="#" class="top2"><span>2</span>Giải trí</a>
					</li>
					
					<li>
						<a href="#" class="top10"><span>3</span>Giải trí</a>
					</li>
					
					<li>
						<a href="#" class="top10"><span>4</span>Giải trí</a>
					</li>
					
					<li>
						<a href="#" class="top10"><span>5</span>Giải trí</a>
					</li>
					
					<li>
						<a href="#" class="top10"><span>6</span>Giải trí</a>
					</li>
					
					<li>
						<a href="#" class="top10"><span>7</span>Giải trí</a>
					</li>
					
					<li>
						<a href="#" class="top10"><span>8</span>Giải trí</a>
					</li>
					
					<li>
						<a href="#" class="top10"><span>9</span>Giải trí</a>
					</li>
					
					<li>
						<a href="#" class="top10"><span>10</span>Giải trí</a>
					</li>
					
				</ul>
			</div>
		</div>
	</section>
	
	
	<section id="right-content">
		<div id="tabContainer">
			<div id="tabs">
				<ul>
					<li id="tabHeader_1">Game hot</li>
					<li id="tabHeader_2">Game tải nhiều</li>
					<li id="tabHeader_3">Game mới ra mắt</li>
				</ul>
			</div>
			<div id="tabscontent">
				<div class="tabpage" id="tabpage_1">
					<?php $stt = 0; foreach ($gamehot as $game): ?>
						<?php  $stt++; ?>
						<?php if($stt == 1) : ?>
							<section class="box-game">
						<?php endif; ?>
							<section class="box">
								<?php echo $this->Html->image($game['Game']['thumbnail'], array('class' => 'img-box')); ?>
								
								<h3 class="game-title">
									<?php echo $this->Html->link($game['Game']['name'], '/game/'.$game['Game']['id'].'-'.$game['Game']['alias']); ?>
								</h3>
								<section class="rating">
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
								</section>
								<p class="genre">
									<?php 
										if(isset($game['Genre'])) {
											foreach($game['Genre'] as $genre){
												echo $this->Html->link($genre['name'], '/the-loai-game/'.$genre['id'].'-'.$genre['alias']);
											}
										}
										
										if(isset($game['Category'])) {
											foreach($game['Category'] as $category){
												echo ', ' .$this->Html->link($category['name'], '/ung-dung/'.$category['id'].'-'.$category['alias']);
											}
										}
									?>
								</p>
								<section class="game-download">
								<?php //pr($game['System'])?>
									<?php
									
										if(!empty($game['System'][0])) {
											echo $this->Html->link($this->Html->image('style-appstore/android-download.png', array( 'width' => 30, 'height' => 30)), $game['System'][0]['GamesSystem']['download'], array('escape' => false));
										}
										
										if(!empty($game['System'][1])) {
											echo $this->Html->link($this->Html->image('style-appstore/ios-download.png', array( 'width' => 30, 'height' => 30)), $game['System'][1]['GamesSystem']['download'], array('escape' => false));
										}
										
										if(!empty($game['System'][2])) {
											echo $this->Html->link($this->Html->image('style-appstore/windowsphone-download.png', array( 'width' => 30, 'height' => 30)), $game['System'][2]['GamesSystem']['download'], array('escape' => false));
										}
									?>
									
								</section>
							</section>
						<?php if($stt == 3): ?>
						</section>
						<?php $stt = 0; endif; ?>
					<?php endforeach; ?>	
				</div>
				
				
				<div class="tabpage" id="tabpage_2">
					<?php $stt = 0; foreach ($gamehot as $game): ?>
						<?php  $stt++; ?>
						<?php if($stt == 1) : ?>
							<section class="box-game">
						<?php endif; ?>
							<section class="box">
								<?php echo $this->Html->image($game['Game']['thumbnail'], array('class' => 'img-box')); ?>
								
								<h3 class="game-title">
									<?php echo $this->Html->link($game['Game']['name'], '/game/'.$game['Game']['id'].'-'.$game['Game']['alias']); ?>
								</h3>
								<section class="rating">
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
								</section>
								<p class="genre">
									<?php 
										foreach($game['Genre'] as $genre){
											echo $this->Html->link($genre['name'], '#');
										} 
									?>
								</p>
								<section class="game-download">
									<a href="#"><img src="img/style-appstore/ios-download.png" alt="" width="30" height="30" /></a>
									<a href="#"><img src="img/style-appstore/android-download.png" alt="" width="30" height="30" /></a>
									<a href="#"><img src="img/style-appstore/windowsphone-download.png" alt="" width="30" height="30"/></a>
									
								</section>
							</section>
						<?php if($stt == 3): ?>
						</section>
						<?php $stt = 0; endif; ?>
					<?php endforeach; ?>
				</div>
				
				
				<div class="tabpage" id="tabpage_3">
					<?php $stt = 0; foreach ($gamenew as $game): ?>
						<?php  $stt++; ?>
						<?php if($stt == 1) : ?>
							<section class="box-game">
						<?php endif; ?>
							<section class="box">
								<?php echo $this->Html->image($game['Game']['thumbnail'], array('class' => 'img-box')); ?>
								
								<h3 class="game-title">
									<?php echo $this->Html->link($game['Game']['name'], '/game/'.$game['Game']['id'].'-'.$game['Game']['alias']); ?>
								</h3>
								<section class="rating">
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
									<a href="#"><img src="img/style-appstore/rat.png" alt="" /></a>
								</section>
								<p class="genre">
									<?php 
										foreach($game['Genre'] as $genre){
											echo $this->Html->link($genre['name'], '#');
										} 
									?>
								</p>
								<section class="game-download">
									<a href="#"><img src="img/style-appstore/ios-download.png" alt="" width="30" height="30"/></a>
									<a href="#"><img src="img/style-appstore/android-download.png" alt="" width="30" height="30"/></a>
									<a href="#"><img src="img/style-appstore/windowsphone-download.png" alt="" width="30" height="30"/></a>
									
								</section>
							</section>
						<?php if($stt == 3): ?>
						</section>
						<?php $stt = 0; endif; ?>
					<?php endforeach; ?>
				</div>
			</div>
		</div>		
	</section>
	
	
</section>